<?php
$this->breadcrumbs=array(
	'Productos'=>array('admin'),
	$model->ref,
);

$this->menu=array(
        array('label'=>'Administrar productos', 'url'=>array('admin')),
        array('label'=>'Crear producto', 'url'=>array('create')),
        array('label'=>'Editar producto', 'url'=>array('update', 'id'=>$model->ref)),
	array('label'=>'Borrar producto', 'url'=>'#', 'linkOptions'=>array('submit'=>array('delete','id'=>$model->ref),'confirm'=>'¿Está seguro que desea eliminar este elemento?')),
);
?>

<h1>Ver producto #<?php echo $model->ref; ?></h1>

<?php 
        $quoteDollar = Config::model()->findByAttributes(array('tag'=>'dollar_quote'));
        $quoteThaiBaht = Config::model()->findByAttributes(array('tag'=>'thai_baht_quote_to_usd'));
        $valuePriceARS = round($model->price_thb * $quoteDollar->value * $quoteThaiBaht->value,2);
        $labelPriceARS = 'Costo (ARS)';
        $valuePriceUSD = round($model->price_thb * $quoteThaiBaht->value,2);
        $labelPriceUSD = 'Costo (USD)';
?>

<?php $this->widget('zii.widgets.CDetailView', array(
	'data'=>$model,
	'attributes'=>array(
		'ref',
                array(
                    'name'=>'collection',
                    'header'=>'Categoría',
                    'value'=>TanaiProductMaster::getCategoryName($model->collection),
                ),
                array(
                    'name'=>'collection_sub',
                    'header'=>'Subcategoría',
                    'value'=>TanaiProductMaster::getSubcategoryName($model->collection_sub),
                ),
                'price_thb',
                array(
                    'name'=>'price_thb2',
                    'label'=>$labelPriceARS,
                    'value'=>$valuePriceARS,
                ),
                array(
                    'name'=>'price_thb3',
                    'label'=>$labelPriceUSD,
                    'value'=>$valuePriceUSD,
                ),
		'grams',
		'p_size',
		'color',
		'metal',
		'stone',
		'comment',
	),
)); ?>
